// Package tree_attribute 111_min_depth
// @Title tree_attribute
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/9/1 18:48
// @Create  2021/9/1 18:48
package tree_attribute

import (
	"go_leetcode/special_practice/3_tree"
	"math"
)

// 获取二叉树的最小深度
func minDepth(root *__tree.MyTreeNode) int {
	if root == nil {
		return 0
	}
	left := minDepth(root.Left)
	right := minDepth(root.Right)
	return int(math.Min(float64(left), float64(right))) + 1
}
